<?php echo $this->BlkListProducts(); ?>

<div class="content margin-top-20">
    <div class="group-new02 width-100">
        <div class="group-new02-title">
            <div class="sub-left color-main">
                <a class="link-sub" href="#"><img src="<?php echo $this->imgUrl; ?>/icons/icon-new.png" alt=""  /></a>
                <p>Sản phẩm mới</p>
            </div>
        </div>
        <div class="group-3 width-100">
            <?php
            $lang = $view->arrParam['lang'];
			if(empty($lang)){
			    $lang = 'vi';
			}else{
			    $lang = $view->arrParam['lang'];
			} 
			
            $items  = $this->Items; 
            foreach($items as $it){
                $itTitle    = $it['name'];
                $itPrice    = $it['price'];
                $realLink   = FILES_PATH. '/products/images450x450/' . $it['picture'];
                if(!empty($it['picture'])){
                    if(file_exists($realLink)){
                        $linkImg	= FILES_URL . '/products/images450x450/' . $it['picture'];
                    }
                    else{
                        $linkImg	= FILES_URL . '/products/images450x450/no-image.jpg';
                    }
                    $picture 	= '<img title="'. $itTitle .'" src="'. $linkImg .'" width="235" height="190" alt="'.$itTitle.'" />';
                }
                else{
                    $linkImg	= FILES_URL . '/news/images450x450/no-image.jpg';
                    $picture 	= '<img title="'. $itTitle .'" src="'. $linkImg .'" width="235" height="190" alt="'.$itTitle.'" />';
                }
                
                $urlOptions = array('module'=>'products',
                                    'controller'=>'index',
                                    'action'=>'detail',
                                    'nname'=>$it['alias'],
                                    'cid'=> $it['cat_id'],
                                    'id'=>$it['id'],
                                    'lang'=>$lang);
                $linkDetail = $this->url($urlOptions,'product-detail');
                
            ?>
                <div class="box-cnt width-24 col-1">
                    <div class="box2">
                        <div class="sp-img">
                            <?php echo $picture; ?>
                            <div class="price">
                                <p class="price01"><?php echo $itPrice; ?> VND</p>
                                <p class="price02">Thêm vào giỏ hàng</p>
                            </div>
                        </div>
                        <a href="#"><h2><?php echo $itTitle; ?></h2></a>
                        <div class="box2-link"><a href="<?php echo $linkDetail;?>">Đặt hàng</a></div>
                    </div>
                    <div class="clear"></div>
                </div>
           <?php } ?> 
        </div>
    </div>
</div>